Integrand size = 23, antiderivative size = 137 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\frac {x}{a^3}+\frac {\left (a^2-4 a b-8 b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{8 a^3 b^{3/2} \sqrt {a+b} f}-\frac {(a+b) \tan (e+f x)}{4 a b f \left (a+b+b \tan ^2(e+f x)\right )^2}+\frac {(a-4 b) \tan (e+f x)}{8 a^2 b f \left (a+b+b \tan ^2(e+f x)\right )} \]
x/a^3+1/8*(a^2-4*a*b-8*b^2)*arctan(b^(1/2)*tan(f*x+e)/(a+b)^(1/2))/a^3/b^( 3/2)/f/(a+b)^(1/2)-1/4*(a+b)*tan(f*x+e)/a/b/f/(a+b+b*tan(f*x+e)^2)^2+1/8*( a-4*b)*tan(f*x+e)/a^2/b/f/(a+b+b*tan(f*x+e)^2)
Result contains complex when optimal does not.
Time = 16.89 (sec) , antiderivative size = 1473, normalized size of antiderivative = 10.75 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\frac {(a+2 b+a \cos (2 e+2 f x))^3 \sec ^6(e+f x) \left (\frac {\left (3 a^2+8 a b+8 b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{5/2}}-\frac {a \sqrt {b} \left (3 a^2+16 a b+16 b^2+3 a (a+2 b) \cos (2 (e+f x))\right ) \sin (2 (e+f x))}{(a+b)^2 (a+2 b+a \cos (2 (e+f x)))^2}\right )}{1024 b^{5/2} f \left (a+b \sec ^2(e+f x)\right )^3}-\frac {(a+2 b+a \cos (2 e+2 f x))^3 \sec ^6(e+f x) \left (-\frac {3 a (a+2 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{(a+b)^{5/2}}+\frac {\sqrt {b} \left (3 a^3+14 a^2 b+24 a b^2+16 b^3+a \left (3 a^2+4 a b+4 b^2\right ) \cos (2 (e+f x))\right ) \sin (2 (e+f x))}{(a+b)^2 (a+2 b+a \cos (2 (e+f x)))^2}\right )}{2048 b^{5/2} f \left (a+b \sec ^2(e+f x)\right )^3}+\frac {(a+2 b+a \cos (2 e+2 f x))^3 \sec ^6(e+f x) \left (\frac {2 \left (3 a^5-10 a^4 b+80 a^3 b^2+480 a^2 b^3+640 a b^4+256 b^5\right ) \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (\cos (2 e)-i \sin (2 e))}{\sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}+\frac {\sec (2 e) \left (256 b^2 (a+b)^2 \left (3 a^2+8 a b+8 b^2\right ) f x \cos (2 e)+512 a b^2 (a+b)^2 (a+2 b) f x \cos (2 f x)+128 a^4 b^2 f x \cos (2 (e+2 f x))+256 a^3 b^3 f x \cos (2 (e+2 f x))+128 a^2 b^4 f x \cos (2 (e+2 f x))+512 a^4 b^2 f x \cos (4 e+2 f x)+2048 a^3 b^3 f x \cos (4 e+2 f x)+2560 a^2 b^4 f x \cos (4 e+2 f x)+1024 a b^5 f x \cos (4 e+2 f x)+128 a^4 b^2 f x \cos (6 e+4 f x)+256 a^3 b^3 f x \cos (6 e+4 f x)+128 a^2 b^4 f x \cos (6 e+4 f x)-9 a^6 \sin (2 e)+12 a^5 b \sin (2 e)+684 a^4 b^2 \sin (2 e)+2880 a^3 b^3 \sin (2 e)+5280 a^2 b^4 \sin (2 e)+4608 a b^5 \sin (2 e)+1536 b^6 \sin (2 e)+9 a^6 \sin (2 f x)-14 a^5 b \sin (2 f x)-608 a^4 b^2 \sin (2 f x)-2112 a^3 b^3 \sin (2 f x)-2560 a^2 b^4 \sin (2 f x)-1024 a b^5 \sin (2 f x)+3 a^6 \sin (2 (e+2 f x))-12 a^5 b \sin (2 (e+2 f x))-204 a^4 b^2 \sin (2 (e+2 f x))-384 a^3 b^3 \sin (2 (e+2 f x))-192 a^2 b^4 \sin (2 (e+2 f x))-3 a^6 \sin (4 e+2 f x)+10 a^5 b \sin (4 e+2 f x)+304 a^4 b^2 \sin (4 e+2 f x)+1056 a^3 b^3 \sin (4 e+2 f x)+1280 a^2 b^4 \sin (4 e+2 f x)+512 a b^5 \sin (4 e+2 f x)\right )}{(a+2 b+a \cos (2 (e+f x)))^2}\right )}{4096 a^3 b^2 (a+b)^2 f \left (a+b \sec ^2(e+f x)\right )^3}-\frac {(a+2 b+a \cos (2 e+2 f x))^3 \sec ^6(e+f x) \left (-\frac {6 a^2 \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (\cos (2 e)-i \sin (2 e))}{\sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}+\frac {a \sec (2 e) \left (\left (-9 a^4-16 a^3 b+48 a^2 b^2+128 a b^3+64 b^4\right ) \sin (2 f x)+a \left (-3 a^3+2 a^2 b+24 a b^2+16 b^3\right ) \sin (2 (e+2 f x))+\left (3 a^4-64 a^2 b^2-128 a b^3-64 b^4\right ) \sin (4 e+2 f x)\right )+\left (9 a^5+18 a^4 b-64 a^3 b^2-256 a^2 b^3-320 a b^4-128 b^5\right ) \tan (2 e)}{a^2 (a+2 b+a \cos (2 (e+f x)))^2}\right )}{2048 b^2 (a+b)^2 f \left (a+b \sec ^2(e+f x)\right )^3} \]
((a + 2*b + a*Cos[2*e + 2*f*x])^3*Sec[e + f*x]^6*(((3*a^2 + 8*a*b + 8*b^2) *ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a + b]])/(a + b)^(5/2) - (a*Sqrt[b]*(3 *a^2 + 16*a*b + 16*b^2 + 3*a*(a + 2*b)*Cos[2*(e + f*x)])*Sin[2*(e + f*x)]) /((a + b)^2*(a + 2*b + a*Cos[2*(e + f*x)])^2)))/(1024*b^(5/2)*f*(a + b*Sec [e + f*x]^2)^3) - ((a + 2*b + a*Cos[2*e + 2*f*x])^3*Sec[e + f*x]^6*((-3*a* (a + 2*b)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a + b]])/(a + b)^(5/2) + (Sqr t[b]*(3*a^3 + 14*a^2*b + 24*a*b^2 + 16*b^3 + a*(3*a^2 + 4*a*b + 4*b^2)*Cos [2*(e + f*x)])*Sin[2*(e + f*x)])/((a + b)^2*(a + 2*b + a*Cos[2*(e + f*x)]) ^2)))/(2048*b^(5/2)*f*(a + b*Sec[e + f*x]^2)^3) + ((a + 2*b + a*Cos[2*e + 2*f*x])^3*Sec[e + f*x]^6*((2*(3*a^5 - 10*a^4*b + 80*a^3*b^2 + 480*a^2*b^3 + 640*a*b^4 + 256*b^5)*ArcTan[(Sec[f*x]*(Cos[2*e] - I*Sin[2*e])*(-((a + 2* b)*Sin[f*x]) + a*Sin[2*e + f*x]))/(2*Sqrt[a + b]*Sqrt[b*(Cos[e] - I*Sin[e] )^4])]*(Cos[2*e] - I*Sin[2*e]))/(Sqrt[a + b]*Sqrt[b*(Cos[e] - I*Sin[e])^4] ) + (Sec[2*e]*(256*b^2*(a + b)^2*(3*a^2 + 8*a*b + 8*b^2)*f*x*Cos[2*e] + 51 2*a*b^2*(a + b)^2*(a + 2*b)*f*x*Cos[2*f*x] + 128*a^4*b^2*f*x*Cos[2*(e + 2* f*x)] + 256*a^3*b^3*f*x*Cos[2*(e + 2*f*x)] + 128*a^2*b^4*f*x*Cos[2*(e + 2* f*x)] + 512*a^4*b^2*f*x*Cos[4*e + 2*f*x] + 2048*a^3*b^3*f*x*Cos[4*e + 2*f* x] + 2560*a^2*b^4*f*x*Cos[4*e + 2*f*x] + 1024*a*b^5*f*x*Cos[4*e + 2*f*x] + 128*a^4*b^2*f*x*Cos[6*e + 4*f*x] + 256*a^3*b^3*f*x*Cos[6*e + 4*f*x] + 128 *a^2*b^4*f*x*Cos[6*e + 4*f*x] - 9*a^6*Sin[2*e] + 12*a^5*b*Sin[2*e] + 68...
Time = 0.38 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.12, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {3042, 4629, 2075, 372, 402, 27, 397, 216, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan (e+f x)^4}{\left (a+b \sec (e+f x)^2\right )^3}dx\) |
\(\Big \downarrow \) 4629 |
\(\displaystyle \frac {\int \frac {\tan ^4(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (a+b \left (\tan ^2(e+f x)+1\right )\right )^3}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 2075 |
\(\displaystyle \frac {\int \frac {\tan ^4(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )^3}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 372 |
\(\displaystyle \frac {\frac {\int \frac {(a-3 b) \tan ^2(e+f x)+a+b}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )^2}d\tan (e+f x)}{4 a b}-\frac {(a+b) \tan (e+f x)}{4 a b \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\) |
\(\Big \downarrow \) 402 |
\(\displaystyle \frac {\frac {\frac {\int \frac {(a+b) \left ((a-4 b) \tan ^2(e+f x)+a+4 b\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{2 a (a+b)}+\frac {(a-4 b) \tan (e+f x)}{2 a \left (a+b \tan ^2(e+f x)+b\right )}}{4 a b}-\frac {(a+b) \tan (e+f x)}{4 a b \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\frac {\frac {\int \frac {(a-4 b) \tan ^2(e+f x)+a+4 b}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{2 a}+\frac {(a-4 b) \tan (e+f x)}{2 a \left (a+b \tan ^2(e+f x)+b\right )}}{4 a b}-\frac {(a+b) \tan (e+f x)}{4 a b \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\) |
\(\Big \downarrow \) 397 |
\(\displaystyle \frac {\frac {\frac {\frac {\left (a^2-4 a b-8 b^2\right ) \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a}+\frac {8 b \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a}}{2 a}+\frac {(a-4 b) \tan (e+f x)}{2 a \left (a+b \tan ^2(e+f x)+b\right )}}{4 a b}-\frac {(a+b) \tan (e+f x)}{4 a b \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {\frac {\frac {\left (a^2-4 a b-8 b^2\right ) \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a}+\frac {8 b \arctan (\tan (e+f x))}{a}}{2 a}+\frac {(a-4 b) \tan (e+f x)}{2 a \left (a+b \tan ^2(e+f x)+b\right )}}{4 a b}-\frac {(a+b) \tan (e+f x)}{4 a b \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\frac {\frac {\frac {\left (a^2-4 a b-8 b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a \sqrt {b} \sqrt {a+b}}+\frac {8 b \arctan (\tan (e+f x))}{a}}{2 a}+\frac {(a-4 b) \tan (e+f x)}{2 a \left (a+b \tan ^2(e+f x)+b\right )}}{4 a b}-\frac {(a+b) \tan (e+f x)}{4 a b \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\) |
(-1/4*((a + b)*Tan[e + f*x])/(a*b*(a + b + b*Tan[e + f*x]^2)^2) + (((8*b*A rcTan[Tan[e + f*x]])/a + ((a^2 - 4*a*b - 8*b^2)*ArcTan[(Sqrt[b]*Tan[e + f* x])/Sqrt[a + b]])/(a*Sqrt[b]*Sqrt[a + b]))/(2*a) + ((a - 4*b)*Tan[e + f*x] )/(2*a*(a + b + b*Tan[e + f*x]^2)))/(4*a*b))/f
3.4.70.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ ), x_Symbol] :> Simp[(-a)*e^3*(e*x)^(m - 3)*(a + b*x^2)^(p + 1)*((c + d*x^2 )^(q + 1)/(2*b*(b*c - a*d)*(p + 1))), x] + Simp[e^4/(2*b*(b*c - a*d)*(p + 1 )) Int[(e*x)^(m - 4)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[a*c*(m - 3) + (a*d*(m + 2*q - 1) + 2*b*c*(p + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[m, 3] && IntBinomialQ[a , b, c, d, e, m, 2, p, q, x]
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ Symbol] :> Simp[(b*e - a*f)/(b*c - a*d) Int[1/(a + b*x^2), x], x] - Simp[ (d*e - c*f)/(b*c - a*d) Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e , f}, x]
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_.)*((e_) + (f_.)*(x _)^2), x_Symbol] :> Simp[(-(b*e - a*f))*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^ (q + 1)/(a*2*(b*c - a*d)*(p + 1))), x] + Simp[1/(a*2*(b*c - a*d)*(p + 1)) Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[c*(b*e - a*f) + e*2*(b*c - a*d) *(p + 1) + d*(b*e - a*f)*(2*(p + q + 2) + 1)*x^2, x], x], x] /; FreeQ[{a, b , c, d, e, f, q}, x] && LtQ[p, -1]
Int[(u_)^(p_.)*(v_)^(q_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*Expa ndToSum[u, x]^p*ExpandToSum[v, x]^q, x] /; FreeQ[{e, m, p, q}, x] && Binomi alQ[{u, v}, x] && EqQ[BinomialDegree[u, x] - BinomialDegree[v, x], 0] && ! BinomialMatchQ[{u, v}, x]
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f _.)*(x_)])^(m_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim p[ff/f Subst[Int[(d*ff*x)^m*((a + b*(1 + ff^2*x^2)^(n/2))^p/(1 + ff^2*x^2 )), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && Inte gerQ[n/2] && (IntegerQ[m/2] || EqQ[n, 2])
Time = 15.43 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.91
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (\frac {1}{8} a^{2}-\frac {1}{2} a b \right ) \tan \left (f x +e \right )^{3}-\frac {a \left (a^{2}+5 a b +4 b^{2}\right ) \tan \left (f x +e \right )}{8 b}}{\left (a +b +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\left (a^{2}-4 a b -8 b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{8 b \sqrt {\left (a +b \right ) b}}}{a^{3}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{3}}}{f}\) | \(124\) |
default | \(\frac {\frac {\frac {\left (\frac {1}{8} a^{2}-\frac {1}{2} a b \right ) \tan \left (f x +e \right )^{3}-\frac {a \left (a^{2}+5 a b +4 b^{2}\right ) \tan \left (f x +e \right )}{8 b}}{\left (a +b +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\left (a^{2}-4 a b -8 b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{8 b \sqrt {\left (a +b \right ) b}}}{a^{3}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{3}}}{f}\) | \(124\) |
risch | \(\frac {x}{a^{3}}-\frac {i \left (a^{3} {\mathrm e}^{6 i \left (f x +e \right )}+12 a^{2} b \,{\mathrm e}^{6 i \left (f x +e \right )}+16 a \,b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+3 a^{3} {\mathrm e}^{4 i \left (f x +e \right )}+26 a^{2} b \,{\mathrm e}^{4 i \left (f x +e \right )}+56 a \,b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+48 b^{3} {\mathrm e}^{4 i \left (f x +e \right )}+3 a^{3} {\mathrm e}^{2 i \left (f x +e \right )}+20 a^{2} b \,{\mathrm e}^{2 i \left (f x +e \right )}+32 a \,b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+a^{3}+6 a^{2} b \right )}{4 a^{3} f \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right )^{2} b}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i b a +2 i b^{2}+a \sqrt {-a b -b^{2}}+2 b \sqrt {-a b -b^{2}}}{a \sqrt {-a b -b^{2}}}\right )}{16 \sqrt {-a b -b^{2}}\, f b a}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i b a +2 i b^{2}+a \sqrt {-a b -b^{2}}+2 b \sqrt {-a b -b^{2}}}{a \sqrt {-a b -b^{2}}}\right )}{4 \sqrt {-a b -b^{2}}\, f \,a^{2}}+\frac {b \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i b a +2 i b^{2}+a \sqrt {-a b -b^{2}}+2 b \sqrt {-a b -b^{2}}}{a \sqrt {-a b -b^{2}}}\right )}{2 \sqrt {-a b -b^{2}}\, f \,a^{3}}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {-2 i b a -2 i b^{2}+a \sqrt {-a b -b^{2}}+2 b \sqrt {-a b -b^{2}}}{a \sqrt {-a b -b^{2}}}\right )}{16 \sqrt {-a b -b^{2}}\, f b a}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {-2 i b a -2 i b^{2}+a \sqrt {-a b -b^{2}}+2 b \sqrt {-a b -b^{2}}}{a \sqrt {-a b -b^{2}}}\right )}{4 \sqrt {-a b -b^{2}}\, f \,a^{2}}-\frac {b \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {-2 i b a -2 i b^{2}+a \sqrt {-a b -b^{2}}+2 b \sqrt {-a b -b^{2}}}{a \sqrt {-a b -b^{2}}}\right )}{2 \sqrt {-a b -b^{2}}\, f \,a^{3}}\) | \(749\) |
1/f*(1/a^3*(((1/8*a^2-1/2*a*b)*tan(f*x+e)^3-1/8*a*(a^2+5*a*b+4*b^2)/b*tan( f*x+e))/(a+b+b*tan(f*x+e)^2)^2+1/8*(a^2-4*a*b-8*b^2)/b/((a+b)*b)^(1/2)*arc tan(b*tan(f*x+e)/((a+b)*b)^(1/2)))+1/a^3*arctan(tan(f*x+e)))
Leaf count of result is larger than twice the leaf count of optimal. 342 vs. \(2 (123) = 246\).
Time = 0.31 (sec) , antiderivative size = 763, normalized size of antiderivative = 5.57 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\left [\frac {32 \, {\left (a^{3} b^{2} + a^{2} b^{3}\right )} f x \cos \left (f x + e\right )^{4} + 64 \, {\left (a^{2} b^{3} + a b^{4}\right )} f x \cos \left (f x + e\right )^{2} + 32 \, {\left (a b^{4} + b^{5}\right )} f x + {\left ({\left (a^{4} - 4 \, a^{3} b - 8 \, a^{2} b^{2}\right )} \cos \left (f x + e\right )^{4} + a^{2} b^{2} - 4 \, a b^{3} - 8 \, b^{4} + 2 \, {\left (a^{3} b - 4 \, a^{2} b^{2} - 8 \, a b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt {-a b - b^{2}} \log \left (\frac {{\left (a^{2} + 8 \, a b + 8 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a b + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 4 \, {\left ({\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{3} - b \cos \left (f x + e\right )\right )} \sqrt {-a b - b^{2}} \sin \left (f x + e\right ) + b^{2}}{a^{2} \cos \left (f x + e\right )^{4} + 2 \, a b \cos \left (f x + e\right )^{2} + b^{2}}\right ) - 4 \, {\left ({\left (a^{4} b + 7 \, a^{3} b^{2} + 6 \, a^{2} b^{3}\right )} \cos \left (f x + e\right )^{3} - {\left (a^{3} b^{2} - 3 \, a^{2} b^{3} - 4 \, a b^{4}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{32 \, {\left ({\left (a^{6} b^{2} + a^{5} b^{3}\right )} f \cos \left (f x + e\right )^{4} + 2 \, {\left (a^{5} b^{3} + a^{4} b^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{4} b^{4} + a^{3} b^{5}\right )} f\right )}}, \frac {16 \, {\left (a^{3} b^{2} + a^{2} b^{3}\right )} f x \cos \left (f x + e\right )^{4} + 32 \, {\left (a^{2} b^{3} + a b^{4}\right )} f x \cos \left (f x + e\right )^{2} + 16 \, {\left (a b^{4} + b^{5}\right )} f x - {\left ({\left (a^{4} - 4 \, a^{3} b - 8 \, a^{2} b^{2}\right )} \cos \left (f x + e\right )^{4} + a^{2} b^{2} - 4 \, a b^{3} - 8 \, b^{4} + 2 \, {\left (a^{3} b - 4 \, a^{2} b^{2} - 8 \, a b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt {a b + b^{2}} \arctan \left (\frac {{\left (a + 2 \, b\right )} \cos \left (f x + e\right )^{2} - b}{2 \, \sqrt {a b + b^{2}} \cos \left (f x + e\right ) \sin \left (f x + e\right )}\right ) - 2 \, {\left ({\left (a^{4} b + 7 \, a^{3} b^{2} + 6 \, a^{2} b^{3}\right )} \cos \left (f x + e\right )^{3} - {\left (a^{3} b^{2} - 3 \, a^{2} b^{3} - 4 \, a b^{4}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{16 \, {\left ({\left (a^{6} b^{2} + a^{5} b^{3}\right )} f \cos \left (f x + e\right )^{4} + 2 \, {\left (a^{5} b^{3} + a^{4} b^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{4} b^{4} + a^{3} b^{5}\right )} f\right )}}\right ] \]
[1/32*(32*(a^3*b^2 + a^2*b^3)*f*x*cos(f*x + e)^4 + 64*(a^2*b^3 + a*b^4)*f* x*cos(f*x + e)^2 + 32*(a*b^4 + b^5)*f*x + ((a^4 - 4*a^3*b - 8*a^2*b^2)*cos (f*x + e)^4 + a^2*b^2 - 4*a*b^3 - 8*b^4 + 2*(a^3*b - 4*a^2*b^2 - 8*a*b^3)* cos(f*x + e)^2)*sqrt(-a*b - b^2)*log(((a^2 + 8*a*b + 8*b^2)*cos(f*x + e)^4 - 2*(3*a*b + 4*b^2)*cos(f*x + e)^2 - 4*((a + 2*b)*cos(f*x + e)^3 - b*cos( f*x + e))*sqrt(-a*b - b^2)*sin(f*x + e) + b^2)/(a^2*cos(f*x + e)^4 + 2*a*b *cos(f*x + e)^2 + b^2)) - 4*((a^4*b + 7*a^3*b^2 + 6*a^2*b^3)*cos(f*x + e)^ 3 - (a^3*b^2 - 3*a^2*b^3 - 4*a*b^4)*cos(f*x + e))*sin(f*x + e))/((a^6*b^2 + a^5*b^3)*f*cos(f*x + e)^4 + 2*(a^5*b^3 + a^4*b^4)*f*cos(f*x + e)^2 + (a^ 4*b^4 + a^3*b^5)*f), 1/16*(16*(a^3*b^2 + a^2*b^3)*f*x*cos(f*x + e)^4 + 32* (a^2*b^3 + a*b^4)*f*x*cos(f*x + e)^2 + 16*(a*b^4 + b^5)*f*x - ((a^4 - 4*a^ 3*b - 8*a^2*b^2)*cos(f*x + e)^4 + a^2*b^2 - 4*a*b^3 - 8*b^4 + 2*(a^3*b - 4 *a^2*b^2 - 8*a*b^3)*cos(f*x + e)^2)*sqrt(a*b + b^2)*arctan(1/2*((a + 2*b)* cos(f*x + e)^2 - b)/(sqrt(a*b + b^2)*cos(f*x + e)*sin(f*x + e))) - 2*((a^4 *b + 7*a^3*b^2 + 6*a^2*b^3)*cos(f*x + e)^3 - (a^3*b^2 - 3*a^2*b^3 - 4*a*b^ 4)*cos(f*x + e))*sin(f*x + e))/((a^6*b^2 + a^5*b^3)*f*cos(f*x + e)^4 + 2*( a^5*b^3 + a^4*b^4)*f*cos(f*x + e)^2 + (a^4*b^4 + a^3*b^5)*f)]
\[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\int \frac {\tan ^{4}{\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{3}}\, dx \]
Time = 0.28 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.19 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\frac {\frac {{\left (a b - 4 \, b^{2}\right )} \tan \left (f x + e\right )^{3} - {\left (a^{2} + 5 \, a b + 4 \, b^{2}\right )} \tan \left (f x + e\right )}{a^{2} b^{3} \tan \left (f x + e\right )^{4} + a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3} + 2 \, {\left (a^{3} b^{2} + a^{2} b^{3}\right )} \tan \left (f x + e\right )^{2}} + \frac {8 \, {\left (f x + e\right )}}{a^{3}} + \frac {{\left (a^{2} - 4 \, a b - 8 \, b^{2}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} a^{3} b}}{8 \, f} \]
1/8*(((a*b - 4*b^2)*tan(f*x + e)^3 - (a^2 + 5*a*b + 4*b^2)*tan(f*x + e))/( a^2*b^3*tan(f*x + e)^4 + a^4*b + 2*a^3*b^2 + a^2*b^3 + 2*(a^3*b^2 + a^2*b^ 3)*tan(f*x + e)^2) + 8*(f*x + e)/a^3 + (a^2 - 4*a*b - 8*b^2)*arctan(b*tan( f*x + e)/sqrt((a + b)*b))/(sqrt((a + b)*b)*a^3*b))/f
Time = 1.25 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.16 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\frac {\frac {8 \, {\left (f x + e\right )}}{a^{3}} + \frac {{\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )} {\left (a^{2} - 4 \, a b - 8 \, b^{2}\right )}}{\sqrt {a b + b^{2}} a^{3} b} + \frac {a b \tan \left (f x + e\right )^{3} - 4 \, b^{2} \tan \left (f x + e\right )^{3} - a^{2} \tan \left (f x + e\right ) - 5 \, a b \tan \left (f x + e\right ) - 4 \, b^{2} \tan \left (f x + e\right )}{{\left (b \tan \left (f x + e\right )^{2} + a + b\right )}^{2} a^{2} b}}{8 \, f} \]
1/8*(8*(f*x + e)/a^3 + (pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan (f*x + e)/sqrt(a*b + b^2)))*(a^2 - 4*a*b - 8*b^2)/(sqrt(a*b + b^2)*a^3*b) + (a*b*tan(f*x + e)^3 - 4*b^2*tan(f*x + e)^3 - a^2*tan(f*x + e) - 5*a*b*ta n(f*x + e) - 4*b^2*tan(f*x + e))/((b*tan(f*x + e)^2 + a + b)^2*a^2*b))/f
Time = 21.39 (sec) , antiderivative size = 1117, normalized size of antiderivative = 8.15 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\text {Too large to display} \]
((tan(e + f*x)^3*(a - 4*b))/(8*a^2) - (tan(e + f*x)*(a + b)*(a + 4*b))/(8* a^2*b))/(f*(2*a*b + a^2 + b^2 + tan(e + f*x)^2*(2*a*b + 2*b^2) + b^2*tan(e + f*x)^4)) - atan(tan(e + f*x)/(32*(b/(4*a) - 1/32)) + tan(e + f*x)/(4*(a /(32*b) - 1/4)))/(a^3*f) + (atan(-(((((-b^3*(a + b))^(1/2)*((2*a^6*b^3 + ( a^7*b^2)/2)/(a^6*b) - (tan(e + f*x)*(512*a^6*b^4 + 256*a^7*b^3)*(-b^3*(a + b))^(1/2)*(4*a*b - a^2 + 8*b^2))/(512*a^4*b*(a^3*b^4 + a^4*b^3)))*(4*a*b - a^2 + 8*b^2))/(16*(a^3*b^4 + a^4*b^3)) - (tan(e + f*x)*(64*a*b^3 - 8*a^3 *b + a^4 + 128*b^4))/(32*a^4*b))*(-b^3*(a + b))^(1/2)*(4*a*b - a^2 + 8*b^2 )*1i)/(16*(a^3*b^4 + a^4*b^3)) - ((((-b^3*(a + b))^(1/2)*((2*a^6*b^3 + (a^ 7*b^2)/2)/(a^6*b) + (tan(e + f*x)*(512*a^6*b^4 + 256*a^7*b^3)*(-b^3*(a + b ))^(1/2)*(4*a*b - a^2 + 8*b^2))/(512*a^4*b*(a^3*b^4 + a^4*b^3)))*(4*a*b - a^2 + 8*b^2))/(16*(a^3*b^4 + a^4*b^3)) + (tan(e + f*x)*(64*a*b^3 - 8*a^3*b + a^4 + 128*b^4))/(32*a^4*b))*(-b^3*(a + b))^(1/2)*(4*a*b - a^2 + 8*b^2)* 1i)/(16*(a^3*b^4 + a^4*b^3)))/(((a*b^2)/4 - (a^2*b)/4 + a^3/32 + b^3)/(a^6 *b) + ((((-b^3*(a + b))^(1/2)*((2*a^6*b^3 + (a^7*b^2)/2)/(a^6*b) - (tan(e + f*x)*(512*a^6*b^4 + 256*a^7*b^3)*(-b^3*(a + b))^(1/2)*(4*a*b - a^2 + 8*b ^2))/(512*a^4*b*(a^3*b^4 + a^4*b^3)))*(4*a*b - a^2 + 8*b^2))/(16*(a^3*b^4 + a^4*b^3)) - (tan(e + f*x)*(64*a*b^3 - 8*a^3*b + a^4 + 128*b^4))/(32*a^4* b))*(-b^3*(a + b))^(1/2)*(4*a*b - a^2 + 8*b^2))/(16*(a^3*b^4 + a^4*b^3)) + ((((-b^3*(a + b))^(1/2)*((2*a^6*b^3 + (a^7*b^2)/2)/(a^6*b) + (tan(e + ...